<?php
if ($_POST) {
    include_once("../../Functions/connectDatabase.php");
    get_connection();
    if ($_SERVER["REQUEST_METHOD"] == "POST") {
            $state = $_POST["state"];
            $remarks = $_POST["remarks"];
            $id = $_POST["id"];
            $sql = "UPDATE review SET review_state='$state',review_remarks='$remarks'
            WHERE review_id='$id'";
            if (mysqli_query($conn, $sql)) {
                echo "<script>alert('审核成功！');window.location.href='./adminShowAll.php'</script>";
            } else {
                $error = mysqli_error($conn);
                $error = str_replace('\'', '', $error);
                echo "<script>alert('审核失败！$error');window.location.href = document.referrer;</script>";
            }
    }
    close_connection();
}
?>